|
![](/i/fill.gif) |
In article <39942cce@news.povray.org>, "Neil Freebairn"
<nei### [at] lineone net> wrote:
> In parsing a declarative, the POV-Ray parser encounters '#declare'
> (or '#local'), stores the identifier 'MyObj', looks for the equals,
> then reads everything after the equals until the end is flagged
> (various conditions apply). At this point, if we could save this
> string - the right-hand side of the equals - against this identifier
> for returning using our function, we'd be home and dry.
I think the scene file is broken into tokens first, however, I really
don't understand the POV parser. This could make recovering the string a
bit more difficult, though probably not impossible.
> Since everything including declaratives has to be achieved through the
> execution of commands for which there always has to be a code string
> representation, so long as we capture all such declaratives, we should
> capture all such changes to an object's state.
Would this be very useful? You would basically have to re-parse the
whole thing, including identifiers, transformations, etc, only in
POV-Script. I think it would be more useful to have the actual object
data be translated into a string, as well as more efficent in use of
memory and simpler. So "sphere {< 3, 5*2, 8>, Rad*0.5}" with Rad==2
would be translated to "sphere{<3,10,8>,1 texture{...}interior{...}",
with object flags and other additional data also being included.
Transforms would be output as matrices. This would be much easier to
parse within POV-Script itself for writing to another file format.
Another use of this feature would be include files and macros which
output a large number of objects...you could save the objects in an
include to save calculation time.
> I should probably talk to the author(s) of the parser. Can you tell me
> who that is?
The authors of the functions are listed in the source code, but
different people have written various parts of the source, and not all
of it is documented. I don't even know if the person who wrote the
original parser is still on the POV Team.
--
Christopher James Huff - Personal e-mail: chr### [at] mac com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |